cairo_region_t *region)
{
GdkGLContext *paint_context;
- GdkDisplay *display;
cairo_surface_t *image;
double device_x_offset, device_y_offset;
cairo_rectangle_int_t rect, e;
guint target;
paint_context = gdk_gl_context_get_current ();
- if (paint_context)
- display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (paint_context));
- else
- display = NULL;
- if (paint_context &&
- GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0 &&
+#ifdef G_ENABLE_DEBUG
+ if (paint_context != NULL)
+ {
+ GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (paint_context));
+
+ if (GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0)
+ return;
+ }
+#endif
+
+ if (paint_context != NULL &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, cairo_surface, region))
return;
int minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+ gboolean force_gles = FALSE;
int version, min_ver;
+#ifdef G_ENABLE_DEBUG
+ GdkDisplay *display;
+#endif
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (!priv->realized);
return;
}
- /* Enforce a minimum context version number of 3.2 */
version = (major * 100) + minor;
- if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_GLES))
+#ifdef G_ENABLE_DEBUG
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+ force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
+#endif
+ /* Enforce a minimum context version number of 3.2 for desktop GL,
+ * and 2.0 for GLES
+ */
+ if (priv->use_es > 0 || force_gles)
min_ver = 200;
else
min_ver = 302;
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+ gboolean force_gles = FALSE;
+#ifdef G_ENABLE_DEBUG
+ GdkDisplay *display;
+#endif
int default_major, default_minor;
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
- if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_GLES))
+#ifdef G_ENABLE_DEBUG
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+ force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
+#endif
+
+ /* Default fallback values for uninitialised contexts; we
+ * enforce a context version number of 3.2 for desktop GL,
+ * and 2.0 for GLES
+ */
+ if (priv->use_es > 0 || force_gles)
{
default_major = 2;
default_minor = 0;
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean has_npot, has_texture_rectangle;
+ gboolean gl_debug = FALSE;
+#ifdef G_ENABLE_DEBUG
+ GdkDisplay *display;
+#endif
if (!priv->realized)
return;
priv->is_legacy = TRUE;
}
- if (priv->has_khr_debug && GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_DEBUG))
+#ifdef G_ENABLE_DEBUG
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+ gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG);
+#endif
+
+ if (priv->has_khr_debug && gl_debug)
{
priv->use_khr_debug = TRUE;
glGetIntegerv (GL_MAX_LABEL_LENGTH, &priv->max_debug_label_length);